--破解by.卑微网管qq459814711--
card_file="/sdcard/.km"
uid="b18722ef30337688571ebffc1dfe4c95"
url = "http://api.gstykm.top/"
id_file = "/storage/emulated/0/Android/.id"
basekey = "AiOZuQBmj1fY9vMosyNc6WKE 8GHPCaq/07LD5hXk4zxnRVFtJewS3rpIbUTlgd2"
key = "独角兽"
sourcecode = ("")
function md5(Text)
return string.lower(Text:gsub(".", function(c)
    return string.format("%02x", (string.byte(c)) % 8888)
  end):gsub(" ", "+"))
end
function idpp()
return os.time()..math.random(100000000,999999999)
end
function Base64de(data)
local b =basekey
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local txt,num='',b:find(x)-1
for i=5,0,-1 do txt,num=txt..string.format("%d",math.floor(num/2^i)),num%2^i  end
return txt;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if #x ~= 8 then return '' end
a=tonumber(x,2)
return string.char(math.floor(a))
end))
end
function Decryption(Text)
return Text:gsub('..', function (youyou) return string.char((tonumber(youyou,16))%256) end)
end
function RC4(key, text)--解密
function KSA(key)
local key_len = string.len(key);local S = {};local key_byte = {};local j = 0
for i = 0, 255 do;S[i] = i;end
for i = 1, key_len do;key_byte[i-1] = string.byte(key, i, i);end
for i = 0, 255 do;j = (j + S[i] + key_byte[i % key_len]) % 256;S[i], S[j] = S[j], S[i]end
return S
end
function PRGA(S, text_len)
local i = 0;local j = 0;local K = {}
for n = 1, text_len do;i = (i + 1) % 256;j = (j + S[i]) % 256;S[i], S[j] = S[j], S[i];K[n] = S[(S[i] + S[j]) % 256];end
return K
end
function output(S, text)
local len = string.len(text);local c;local res = {}
for i = 1, len do;c = string.byte(text, i, i);res[i] = string.char(base(S[i], c));end
return table.concat(res)
end
function base(a, b)
if a < b then;a, b = b, a;end
local res = 0;local shift = 1
while a ~= 0 do;r_a = a % 2;r_b = b % 2;res = shift * ((r_a+ r_b== 1) and 1 or 0) + res;shift = shift * 2;a = math.modf(a / 2);b = math.modf(b / 2);end
return res
end
return output(PRGA(KSA(key),string.len(text)),text)
end

if io.open(card_file)==nil then
  card=nil
 else
  card=io.open(card_file):read("*a")
end
if not io.open(id_file) then
  id=false
 else
  id=io.open(id_file):read("*a")
end
function getweb(code)
  if code=="缺少提交值" then
    return true
   elseif code=="卡密不存在" then
    return true
   elseif code=="卡密以到期自动销毁" then
    return true
   elseif code=="你被管理员列为黑名单" then
    return true
  end
  return true
end
function b()
  txt=gg.makeRequest(url.."ckgg.php?uid="..uid).content
  gg.alert("卑微网管破解")
  k=idpp()
  Login=gg.prompt({"输入脚本卡密:"},{card},{"text"})
  if Login==nil then
    EXIT=gg.alert("是否退出","退出","返回")
    if EXIT==1 then
      print("退出成功")
      os.exit()
     else
      b()
    end
   else
    if Login[1]=="" then
      EXIT=gg.alert("未检测到卡密","返回","退出")
      if EXIT==2 then
        print("退出成功")
        os.exit()
       else
        b()
      end
    end
  end
  time = os.date("%H%M")
  link=gg.makeRequest(url.."km.php?uid="..uid.."&km="..Login[1].."&id="..md5(k)).content
  if link:find("成功激活:【(.-)】") then
    rq =link:match("成功激活:【(.-)】")
    if link=="成功激活:【"..rq.."】" then
      io.open(id_file,"w"):write(k)
      io.open(card_file,"w"):write(Login[1])
      print("欢迎使用卡密:"..rq)
      os.exit()
     else
      gg.alert("错误卡密!")
    end
  end
  pdkm=getweb(link)
  if pdkm then
    id_dynamic =uid..key..id..time
    message ="创建时间:【2020-01-01 23:59:59】到期时间:【2099-01-01 23:59:59】剩余时间:【34500000000】ID动态:【Lulvwje8Kw9Z9wvw IMZ6p9KW78h8L9Kyh8cyLMcEX7Uwk4bY50HSJvLASvc/e9L6tvcPwvc/pvwPp9Lue9A==】脚本名:【9LAe9ZuJ9Z6J9L9e9wupvZ/VHmW0】"
    create_time = message:match("创建时间:【(.-)】")
    expire_time = message:match("到期时间:【(.-)】")
    surplus_time = message:match("剩余时间:【(.-)】")
    dynamic_id = message:match("ID动态:【(.-)】")
    lua_name = message:match("脚本名:【(.-)】")
    dynamic_id = Base64de(dynamic_id)
    lua_name = Base64de(lua_name)
    surplus_time=surplus_time/86400
    if id_dynamic==dynamic_id then
      gg.alert("登录成功\n创建时间:"..create_time.."\n到期时间:"..expire_time.."\n剩余时间:"..surplus_time.."天\n正在前往脚本")
      pcall(load(gg.makeRequest(url.."script/"..lua_name).content))
     else
      gg.alert("登录成功\n创建时间:"..create_time.."\n到期时间:"..expire_time.."\n剩余时间:"..surplus_time.."天\n正在前往脚本")
      pcall(load(gg.makeRequest(url.."script/"..lua_name).content))
    end
   else
    os.exit()
  end
end
b()

